home *** CD-ROM | disk | FTP | other *** search
/ 3D World 110 / 3DW_110.iso / mac / Menu / Scenes / home.dir / 00044_Script_Media Controls < prev    next >
Text File  |  2008-09-12  |  2KB  |  114 lines

  1. ---Media Controls
  2.  
  3. global gRootPath
  4. global gDiv
  5. global mp3List
  6. global selecta
  7.  
  8.  
  9. on stopmovie
  10.   repeat with i = 1 to the number of members of castlib(5)
  11.     member(i, 5).erase()
  12.   end repeat
  13.   
  14.   --member("stub_image_holder").erase()
  15.  
  16. end
  17.  
  18.  
  19.  
  20.  
  21. on InitMediaPlayer
  22.   
  23.   repeat with i = 1 to the number of members of castlib(5)
  24.     member(i, 5).erase()
  25.   end repeat
  26.   
  27.   
  28.   
  29.   mp3List = []
  30.   thePath = gRootPath & "DiscContent" & gDiv & "Resources" & gDiv & "PodCasts" & gDiv
  31.   
  32.   
  33.   u = getnetText(thePath & "playlist.txt")
  34.   if netDone(u) then
  35.     c = netTextResult(u)
  36.   end if
  37.   
  38.   iCount = 1
  39.   
  40.   repeat with i = 1 to c.line.count
  41.     mp3List[iCount] = [:]
  42.     mp3List[iCount][#pTitle] = c.line[i]
  43.     
  44.     i=i+1
  45.     
  46.     o = new(#Sound, castlib(5))
  47.     
  48.     o.filename = thePath & c.line[i]
  49.     
  50.     
  51.     
  52.     mp3List[iCount][#pFilename] = o
  53.     
  54.     
  55.     
  56.     
  57.     
  58.     iCount = iCount + 1
  59.     
  60.   end repeat
  61.   
  62.   selecta = 1
  63.   
  64.   put mp3List[1].pFilename
  65.   
  66.   sound(2).queue(mp3List[1].pFilename)
  67.   
  68.   member("tickertape").text = "Click the 'play' button to begin playing the podcasts"
  69.   
  70.   put "MP3 Player Done"
  71.   
  72.   
  73.   
  74. end
  75.  
  76.  
  77.  
  78. on PlayMedia
  79.   Sound(2).play()
  80.   member("tickertape").text = mp3List[selecta].pTitle
  81. end
  82.  
  83. on PauseMedia
  84.   Sound(2).pause()
  85. end
  86.  
  87. on NextMedia
  88.   selecta = selecta + 1
  89.   if selecta > mp3List.count then
  90.     selecta = 1
  91.   end if
  92.   
  93.   
  94.   sound(2).stop()
  95.   sound(2).queue(mp3List[selecta].pFilename)
  96.   member("tickertape").text = mp3List[selecta].pTitle
  97.   sound(2).play()
  98. end
  99.  
  100. on PrevMedia
  101.   selecta = selecta - 1
  102.   if selecta < 1 then
  103.     selecta = mp3List.count
  104.   end if
  105.   sound(2).stop()
  106.   sound(2).queue(mp3List[selecta].pFilename)
  107.   member("tickertape").text = mp3List[selecta].pTitle
  108.   sound(2).play()
  109. end
  110.  
  111. on StopMedia
  112.   sound(2).stop()
  113. end
  114.